<?php

use yii\helpers\Html;

/* @var $this \yii\web\View */
/* @var $content string */
// $directoryAsset = \Yii::$app->czaHelper->getEnvData('AdminlteAssets');
?>

<aside class="main-sidebar">
    <section class="sidebar">
        <!-- Sidebar user panel -->
        <!-- search form -->
        <form action="#" method="get" class="sidebar-form">
            <div class="input-group">
                <input type="text" name="q" class="form-control" placeholder="<?= Yii::t('app.c2', 'Search...') ?>"/>
                <span class="input-group-btn">
                    <button type='submit' name='search' id='search-btn' class="btn btn-flat"><i
                                class="fa fa-search"></i>
                    </button>
                </span>
            </div>
        </form>
        <!-- /.search form -->
        <?=
        \backend\components\widgets\Menu::widget(
            [
                'options' => ['class' => 'sidebar-menu', "data-widget" => "tree"],
                'linkTemplate' => '<a href="{url}" {targetPlaceHolder}>{icon} {label}</a>',
                'items' => [
                    ['label' => Yii::t('app.c2', 'Menu'), 'options' => ['class' => 'header']],
                    ['label' => Yii::t('app.c2', 'FeUser Management'), 'icon' => 'fa fa-circle-o', 'url' => ['/fe-user']],
                    ['label' => Yii::t('app.c2', 'Proprietor Management'), 'icon' => 'fa fa-circle-o', 'url' => ['/proprietor']],
                    ['label' => Yii::t('app.c2', 'Device Management'), 'icon' => 'fa fa-circle-o', 'url' => ['/device']],
                    ['label' => Yii::t('app.c2', 'House Management'), 'icon' => 'fa fa-circle-o', 'url' => ['/house']],
                    ['label' => Yii::t('app.c2', 'Unit Management'), 'icon' => 'fa fa-circle-o', 'url' => ['/unit']],
                    ['label' => Yii::t('app.c2', 'Building Number Management'), 'icon' => 'fa fa-circle-o', 'url' => ['/building-number']],
                    ['label' => Yii::t('app.c2', 'Community Management'), 'icon' => 'fa fa-circle-o', 'url' => ['/community']],
                    ['label' => Yii::t('app.c2', 'Life Bill Management'), 'icon' => 'fa fa-circle-o', 'url' => ['/life-bill']],
                    ['label' => Yii::t('app.c2', 'Vip coupon Management'), 'icon' => 'fa fa-circle-o', 'url' => ['/vip']],
                    ['label' => Yii::t('app.c2', 'App Version Management'), 'icon' => 'fa fa-circle-o', 'url' => ['/app-version']],
                    // ['label' => Yii::t('app.c2', 'Fe User'), 'icon' => 'fa fa-circle-o', 'url' => ['/fe-user']],
                    ['label' => Yii::t('app.c2', 'Material'), 'icon' => 'fa fa-circle-o', 'visible' => \Yii::$app->user->can('P_SYSTEM'), 'url' => ['/material']],
                    ['label' => Yii::t('app.c2', 'Post Manager'), 'icon' => 'fa fa-circle-o', 'visible' => \Yii::$app->user->can('P_SYSTEM'), 'url' => ['/post']],
                    [
                        'label' => Yii::t('app.c2', 'System'), 'icon' => 'fa fa-circle-o', 'url' => ['#'], 'options' => ['class' => 'treeview'],
                        'visible' => \Yii::$app->user->can('P_SYSTEM'),
                        'items' => [
                            [
                             'label' => Yii::t('app.c2', 'Common Resource'), 'icon' => 'fa fa-circle-o', 'url' => ['#'], 'options' => ['class' => 'treeview'],
                                'items' => [
                                    ['label' => Yii::t('app.c2', 'Attachement Management'), 'icon' => 'fa fa-circle-o', 'url' => ['/sys/common-resource/attachment'],],
                                    ['label' => Yii::t('app.c2', 'Config'), 'icon' => 'fa fa-circle-o', 'url' => ['/sys/common-resource/config']],
                                ]
                            ],
                            [
                                'label' => Yii::t('app.c2', 'Security'), 'icon' => 'fa fa-circle-o', 'url' => ['#'], 'options' => ['class' => 'treeview'],
                                'items' => [
                                    ['label' => Yii::t('app.c2', 'Users & Rbac'), 'icon' => 'fa fa-circle-o', 'url' => ['/user/admin']],
                                    ['label' => Yii::t('app.c2', 'Route'), 'icon' => 'fa fa-circle-o', 'url' => ['/rbac/route']],
                                    ['label' => Yii::t('app.c2', 'Permission'), 'icon' => 'fa fa-circle-o', 'url' => ['/rbac/permission']],
                                    ['label' => Yii::t('app.c2', 'Role'), 'icon' => 'fa fa-circle-o', 'url' => ['/rbac/role']],
                                ]
                            ],
                        ]
                    ],

                    ['label' => Yii::t('app.c2', 'Sign out'), 'icon' => 'fa fa-sign-out', 'url' => ['/user/logout']],
                ],
            ]
        )
        ?>

    </section>

</aside>
